﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;

using BartonExtension;

namespace iShangMai.Controllers.App
{
    public class LaozhangdebiantaiAPIController : ApiController
    {
        public string GetFormatted(string str)
        {
            var result = "";
            string[] lines = str.Split(new string[]{"\n"},StringSplitOptions.None);
            foreach(string line in lines)
            {
                if(line != lines.Last())
                {
                    result += "'{0}'+\n".FormatWith(line.Trim());
                }
                else
                {
                    result += "'{0}'".FormatWith(line.Trim());
                }
            }
            return result;
        }
    }
}
